<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>无标题文档</title>
<link href="__PUBLIC__/admin/sncss/css/style.css" rel="stylesheet" type="text/css" />
<script type="text/javascript" src="__PUBLIC__/admin/sncss/js/jquery.js"></script>
<link href="__PUBLIC__/admin/sncss/css/combo.select.css" rel="stylesheet" type="text/css" />


</head>


<body>

	<div class="place">
		<span>位置：</span>
		<ul class="placeul">
		<li><a>首页</a></li>
		<li><a>主播管理</a></li>
		<li><a>主播列表</a></li>
		</ul>
		</div>

		<div class="rightinfo">


		<form id="form1" name="form1" method="get" action="{:U('/Home/User/user_list')}">
			<div class="tools">
			 <!-- Unnamed (下拉列表框) -->

			<!-- <div style="float: left;">
				<select class="newselect" id="u1_input" name="labelkey" >
					<option selected value="0">请选择标签</option>
					<?php foreach ($labeldata as $key => $value) {?>
					<option  value="<?php echo $value['label_id'];?>" <?php if($labelkey == $value['label_id']){echo "selected='selected'";}?>><?php echo $value['label_name'];?></option>
					<?php }?>
				</select>
			</div> -->
			<div style="float: left;">
				<select class="newselect" id="u1_input" name="levelkey" >
					<option selected value="0">请选择等级</option>
					<?php foreach ($leveldatadesc as $key => $value) {?>
					<option  value="<?php echo $value['id'];?>" <?php if($levelkey == $value['id']){echo "selected='selected'";}?>><?php echo $value['message'];?></option>
					<?php }?>
				</select>
			</div>
			<div style="float: left;">
				<select id="u2_input" name="sex" >
					<option  value="0" <?php if($sex == 0){echo "selected='selected'";}?>>选择性别</option>
					<option  value="1" <?php if($sex == 1){echo "selected='selected'";}?>>男</option>
					<option  value="2" <?php if($sex == 2){echo "selected='selected'";}?>>女</option>
				</select>
			</div>
			<!--<div style="float: left;">-->
				<!--<select id="u3_input" name="select_wx" >-->
					<!--<option  value="0" <?php if($select_wx == 0){echo "selected='selected'";}?>>是否绑定微信</option>-->
					<!--<option  value="1" <?php if($select_wx == 1){echo "selected='selected'";}?>>已绑定</option>-->
					<!--<option  value="2" <?php if($select_wx == 2){echo "selected='selected'";}?>>未绑定</option>-->
				<!--</select>-->
			<!--</div>-->
			<!-- <div style="float: left;">
				<select id="u3_input" name="mediakey" >
					<option selected value="0">请选择自媒体</option>
					<?php foreach ($medialist as $key => $value) {?>
					<option  value="<?php echo $value['id'];?>" <?php if($mediakey == $value['id']){echo "selected='selected'";}?>><?php echo $value['media_name'];?></option>
					<?php }?>
				</select>
			</div> -->
			<div style="float: left;">
				<select id="u4_input" name="authkey" >
					<option  value="0" <?php if($authkey == 0){echo "selected='selected'";}?>>选择认证</option>
					<option  value="1" <?php if($authkey == 1){echo "selected='selected'";}?>>已认证</option>
					<option  value="2" <?php if($authkey == 2){echo "selected='selected'";}?>>未认证</option>
				</select>
			</div>
			<div style="float: left; margin-bottom: 15px;line-height: 40px;" id="soundtype">
				<label>类型</label>
				<label><input type='checkbox'  value='1' <?php echo strstr($soundtype,'1')?'checked="checked"':'';?>>讲述类</label>
				<label><input type='checkbox'  value='2' <?php echo strstr($soundtype,'2')?'checked="checked"':'';?>>情感类</label>
				<label><input type='checkbox'  value='3' <?php echo strstr($soundtype,'3')?'checked="checked"':'';?>>演绎类</label>
				<label><input type='checkbox'  value='4' <?php echo strstr($soundtype,'4')?'checked="checked"':'';?>>新闻类</label>
				<label><input type='checkbox'  value='5' <?php echo strstr($soundtype,'5')?'checked="checked"':'';?>>英语</label>
				<label><input type='checkbox'  value='6' <?php echo strstr($soundtype,'6')?'checked="checked"':'';?>>自选</label>
				<label><input type='checkbox'  value='7' <?php echo strstr($soundtype,'7')?'checked="checked"':'';?>>背景音</label>
			</div>
			<input type="hidden" name="soundtype" id="soundtype_hidden">
			</div>
			<!-- Unnamed (下拉列表框) -->
			<div class="tools">
			<div style="float: left; margin-bottom: 15px;">
				<input name="user_name" style="height: 38px;" type="text" class="dfinput" placeholder="搜索编号/姓名/昵称/手机号" id="user" value="<?php echo $user_name;?>" />
			</div>
			<div style="float: left; margin-bottom: 15px;">
				<a href="javascript:soundtype()" style="border:none;width:100px;height:40px; font-size:14px; cursor:pointer; line-height:40px;background:#61afdf;color:#fff;text-align:center;text-indent:0;display:block;float: left;margin-left: 5px;">搜索</a>
				<!--<input name="" id="from_submit" style="height: 40px;" type="submit" class="btn" value="搜索"/>-->
			</div>

		<a href="{:U('/Home/Export/member',array('levelkey'=>$levelkey,'sex'=>$sex,'authkey'=>$authkey,'soundtype'=>$soundtype,'user_name'=>$user_name))}" style="border:none;width:100px;height:40px; font-size:14px; cursor:pointer; line-height:40px;background:#61afdf;color:#fff;text-align:center;text-indent:0;display:block;float: left;margin-left: 5px;">导出</a>
			</div>
			</form>
		<table class="tablelist">
			<thead>
			<tr>
				<th>编号<i class="sort"><img src="__PUBLIC__/admin/sncss/images/px.gif" /></i></th>
				<th>昵称</th>
				<if condition="$founder neq 3"><th>手机号</th></if>
				<th>年龄</th>
				<th>性别</th>
				<th>等级(分)</th>
				<th>信用分</th>
				<!-- <th width="200">被签约的自媒体</th> -->
				<th>是否绑定微信</th>
				<th>是否认证</th>
				<th>余额</th>
				<th>邀请人昵称</th>
				<th>操作</th>
				</tr>
				</thead>
				<tbody>

		<foreach name='userinfo' item='v'>
				<tr>
				<td>{$v.uuid}</td>
				<td>{$v.nickname}</td>
				<if condition="$founder neq 3"><td>{$v.username}</td></if>
				<td>{$v.age}</td>
				<if condition="$v.sex == 1">
					<td>男</td>
					<else />
					<td>女</td>
				</if>

				<td>{$v.level_type}({$v.level})</td>
				<td>{$v.score}</td>
				<!-- <td>{$v.mediadata}</td> -->
				<td><empty name="v.openid">未绑定<else />已绑定</empty></td>
				<td>
					<switch name="v.authentication" >
						<case value="0">否</case>
						<case value="1">是</case>
						<default />未知
					</switch>
				</td>
				<td>{$v.balance}</td>
				<td>{$v.invite_nickname}</td>
				<td>
				<if condition="$founder neq 3"><a href="{:U('/Home/User/user_invite',array('uid'=>$v['uuid']))}" class="tablelink">邀请数({$v.invitecount})</a>&nbsp;
				<a href="{:U('/Home/User/user_message',array('uid'=>$v['id'],'p'=>$p,'authkey'=>$authkey))}" class="tablelink">详情</a>&nbsp;</if>
				<a href="{:U('/Home/User/user_order',array('uuid'=>$v['uuid']))}" class="tablelink">订单({$v.ordernum})</a>&nbsp;
				<!-- <if condition="$authkey eq 1">
				<a href="{:U('/Home/User/user_signorder',array('uuid'=>$v['uuid']))}" class="tablelink">签约订单</a>&nbsp;
				</if> -->
				<!-- <if condition="$mediakey">
					<if condition="in_array($v['uuid'],$mediacollect) ">
					已签约
					<else />
					<a href="{:U('/Home/User/user_binding',array('mediaid'=>$mediakey,'uuid'=>$v['uuid']))}" class="tablelink" onclick="if(confirm('确定<{$v[nickname]}>被<?php echo "《".$media_name."》";?>签约吗?')==false)return false;">签约</a>&nbsp;
					</if>
				</if> -->
				<!-- <a class="tablelink" onclick="passwords('{$v[uuid]}','{$v[username]}','{$v[nickname]}')" >删除</a>&nbsp; -->
				<if condition="$founder neq 3"><a class="tablelink" onclick="addscore('{$v[uuid]}','{$v[username]}','{$v[nickname]}')" >加分</a></if>
					<if condition="$add_del eq 1"><a class="tablelink" onclick="addbalance('{$v[uuid]}','{$v[username]}','{$v[nickname]}')" >加钱</a></if>

				</td>
				</tr>
			 </foreach>
				</tbody>
		</table>
		<style>.pages a,.pages span {
		display:inline-block;
		padding:2px 5px;
		margin:0 1px;
		border:1px solid #f0f0f0;
		-webkit-border-radius:3px;
		-moz-border-radius:3px;
		border-radius:3px;
}
.pages a,.pages li {
		display:inline-block;
		list-style: none;
		text-decoration:none; color:#58A0D3;
}
.pages a.first,.pages a.prev,.pages a.next,.pages a.end{
		margin:0;
}
.pages a:hover{
		border-color:#50A8E6;
}
.pages span.current{
		background:#50A8E6;
		color:#FFF;
		font-weight:700;
		border-color:#50A8E6;
}</style>

	 <div class="pages"><br />

												<div align="right">{$page}
												</div>
	 </div>

		</div>



</body>
<script src="__PUBLIC__/admin/Js/jquery-1.7.2.min.js"></script>
<script src="__PUBLIC__/admin/Js/jquery.combo.select.js"></script>
<script type="text/javascript">
	function soundtype(){
        var arr = new Array();
        $("#soundtype :checkbox[checked]").each(function(i){
            arr[i] = $(this).val();

//			str = str +','+ $(this).val();
        });
        var vals = arr.join(",");
		$('#soundtype_hidden').val(vals);
        $('#form1').submit();
	}

</script>
<script type="text/javascript">
	$('.tablelist tbody tr:odd').addClass('odd');
	$(function() {
		$('#u1_input').comboSelect();
		$('#u2_input').comboSelect();
		$('#u3_input').comboSelect();
		$('#u4_input').comboSelect();
	});
</script>
<script src="__PUBLIC__/layer/layer.js"></script>

<script type="text/javascript">
function passwords(uuid,tel,name){
	if(confirm('确定删除主播吗')==false)return false;
	if(confirm('真的要删除吗')==false)return false;
	layer.open({title: false, type: 1, area: ['400px', '200px'], //宽高
		content: '<div class="mainlist" style="padding:30px;"><form id="form2" name="form2" method="post" action="/Home/User/user_delete" onsubmit="return form2_submit('+uuid+');">'
		+'请输入密码<br><br>'
		+'<input id="password'+uuid+'" name="password" class="dfinput" value="" />'
		+'<input name="uuid" type="hidden" value="'+uuid+'" />'
		+'<input name="tel" type="hidden" value="'+tel+'" />'
		+'<input name="name" type="hidden" value="'+name+'" />'
		+'<br><br><input type="submit" class="btn" value="确认"/></form></div>'
	});
}
function form2_submit(uuid){
	var password= $("#password"+uuid+"").val();
	if(password.length==0){
			layer.msg('必须填密码');return false;
	}
	$("#overflow").attr("disabled","disabled");
	layer.load(1, {shade: [0.8, '#393D49']});
}

function addscore(uuid,tel,name){
	if(confirm('确定给'+uuid+'加分吗')==false)return false;
	if(confirm('真的要给：'+name+'-'+tel+'加分吗')==false)return false;
	layer.open({title: false, type: 1, area: ['400px', '200px'], //宽高
		content: '<div class="mainlist" style="padding:30px;"><form id="form2" name="form2" method="post" action="/Home/User/add_score" onsubmit="return form3_submit('+uuid+');">'
		+'请输入分数<br><br>'
		+'<input id="addscore'+uuid+'" name="addscore" class="dfinput" value="" />'
		+'<input name="uuid" type="hidden" value="'+uuid+'" />'
		+'<br><br><input type="submit" class="btn" value="确认"/></form></div>'
	});
}
function form3_submit(uuid){
	var addscore= $("#addscore"+uuid+"").val();
	if(addscore.length==0){
			layer.msg('必须填分数');return false;
	}
	$("#overflow").attr("disabled","disabled");
	layer.load(1, {shade: [0.8, '#393D49']});
}
function addbalance(uuid,tel,name){
	if(confirm('确定给'+uuid+'加钱吗')==false)return false;
	if(confirm('真的要给：'+name+'-'+tel+'加钱吗')==false)return false;
	layer.open({title: false, type: 1, area: ['500px', '300px'], //宽高
		content: '<div class="mainlist" style="padding:30px;"><form id="form2" name="form2" method="post" action="/Home/User/add_balance" onsubmit="return form4_submit('+uuid+');">'
        +'请输入钱数:<br><input type="number" id="addmoney'+uuid+'" name="addmoney" class="dfinput" value="" /><br><br>'
        +'理由：<input id="note'+uuid+'" name="note" class="lginput" value="" />'
        +'<br><div>加钱理由建议在20个字符以内</div>'
        +'<input name="uuid" type="hidden" value="'+uuid+'" />'
        +'<br><br><input type="submit" class="btn" value="确认"/></form></div>'
	});
}
function form4_submit(uuid){
	var addmoney= $("#addmoney"+uuid+"").val();
	var note= $("#note"+uuid+"").val();
	if(addmoney.length==0){
			layer.msg('必须填钱数');return false;
	}
    if(note.length==0){
        layer.msg('必须输入理由');return false;
    }
	$("#overflow").attr("disabled","disabled");
	layer.load(1, {shade: [0.8, '#393D49']});
}
</script>
</html>
